// 存储路由映射表
import Home from "../views/Home";
import Crm from '../components/crm/index'
import Org from '../components/org/index'

export default [
    {
        path: '/',
        name: 'Home',
        component: Home,
        redirect:'/crm',
        children: [
            {
                path: '/crm',
                name: 'crm',
                component: Crm,
                meta: {
                    // 路由原信息
                    // 存放自定义属性
                    til:'客户管理'
                },
                children: [
                    {
                        path: '/crm/custom',
                        name: 'custom',
                        component: () => import('../components/crm/custom/custom')
                    },
                    {
                        path: '/crm/addCustom',
                        name: 'addCustom',
                        component: () => import('../components/crm/custom/addCustom')
                    },
                    {
                        path: '/crm/uploadCustom',
                        name: 'uploadCustom',
                        component: () => import('../components/crm/custom/uploadCustom')
                    },
                    {
                        path: '/crm/visitHandle/:customid',
                        name: 'visitHandle',
                        component: () => import('../components/crm/custom/visitHandle')
                    },
                ]
            },
            {
                path: '/org',
                name: 'org',
                component: Org,
                meta: {
                    til: '组织结构'
                },
                children: [
                    {
                        path: '/org/list',
                        name: 'orgList',
                        component:()=>import('../components/org/department/list')
                    },
                    {
                        path: '/org/add',
                        name: 'orgAdd',
                        component:()=>import('../components/org/department/add')
                    },
                    {
                        path: '/org/user',
                        name: 'userList',
                        component: ()=> import('../components/org/user/user')
                    },
                    {
                        path: '/org/addUser',
                        name: 'addUser',
                        component: () => import('../components/org/user/addUser')
                    },
                    {
                        path: '/org/job',
                        name: 'jobList',
                        component: () => import('../components/org/job/job')
                    },
                    {
                        path: '/org/addJob',
                        name: 'addJob',
                        component: () => import('../components/org/job/addJob')
                    }
                ]
            }
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/login')
    },
    {
        path: '*',
        redirect: '/'
    },
]